﻿<#include "include/_meta.html">
<title>管理员列表</title>
</head>
<body>
<div class="page-container">
    <table id="userListTable" width="700px" border="1" class="table table-border table-bordered table-bg table-hover">
        <thead>
        <tr class="text-c">
            <th width="50"><input type="checkbox" name="uid" id="uid" value=""></th>
            <th width="100">编号</th>
            <th width="300">相对路径</th>
            <th width="200">权限名称</th>
            <th width="300">操作</th>
        </tr>
        </thead>
        <tbody>
        <#list resList as res>
            <tr>
                <td width="50"><input type="checkbox" name="useritem" value="${res.permisid}"></td>
                <td width="100">${res.permisid}</td>
                <td width="300">${res.relateurl}</td>
                <td width="200">${res.permisname}</td>
                <td width="300">
                    <a href="javascript:;" class="btn btn-primary radius" name="${res.permisid}"
                       onclick="fun_resource_edit('修改权限信息','/resources/toResourcesEdit?permisid=',${res.permisid},'600','500')">修改</a>&nbsp;&nbsp;&nbsp;

                    <a href="javascript:;" name="${res.permisid}" class="btn btn-primary radius"
                       onclick="fun_resource_del(${res.permisid})">删除</a>
                </td>
            </tr>
        </#list>
        </tbody>
    </table>
</div>
<#include "include/_footer.html">

<script type="text/javascript">

    /*管理员-删除*/
    function fun_resource_del(permisid) {
        layer.confirm('确认要删除吗？', function (index) {
            //此处请求后台程序，下方是成功后的前台处理……
            $.ajax({
                type: "POST",
                url: "/resources/delResources",
                data: "checkedList=" + permisid,
                success: function (msg) {
                    location.replace(location.href);
                }
            });
            $(obj).parents("tr").remove();
            layer.msg('已删除!', {icon: 1, time: 1000});
        });
    }

    /*管理员-编辑*/
    function fun_resource_edit(title, url,id, w, h) {
        layer_show(title, url+id, w, h);
    }

</script>
</body>
</html>